#include "OS_Event.h"


uint8	os_event[MAX_EVENT/8];		//	

const unsigned char	TAB_BIT[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};


void	OS_SetEvent(uint8	event)
{
	os_event[event>>3] |= TAB_BIT[event&0x07];
}

void	OS_ClrEvent(uint8	event)
{
	os_event[event>>3] &= ~TAB_BIT[event&0x07];
}

uint8	OS_GetEvent(uint8	event)
{
	if(os_event[event>>3] & TAB_BIT[event&0x07])	return	YES;
	else	return	NO;
}

void	OS_initEvent(void)
{
	uint8	i;
	for(i=0; i<MAX_EVENT/8; i++)
		os_event[i] = 0;
}



